package Draw;


import Chess.BorderPane;
import Chess.Controller;
import Chess.Main;
import Chess.chessPiece;
import Run.whitePawnStrategy;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

public class whitepawn {
	int cellent = 90; 
	public void whitepawn(int x,int y,int[][] chess){		
		 Color color = new Color(0,0,0,0.5);
		 try{			 
			if(chess[y-1][x+1]==2){
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect((x+1)*cellent, (y-1)*cellent, cellent, cellent);
			
		    }
		 }catch(Exception ex){
			 
		 }
		 try{
			if(chess[y-1][x-1]==2){
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect((x-1)*cellent, (y-1)*cellent, cellent, cellent);
		}
			}catch(Exception ex){
				
			}
		
		
		if(chess[y-1][x]!=2&&chess[y-1][x]!=1){
			if(y==6&&chess[y-2][x]!=2&&chess[y-2][x]!=1){
				for(int i = y-1;i>=y-2;i--){
					BorderPane.gc.setFill(color);
					BorderPane.gc.fillRect(x*cellent, i*cellent, cellent, cellent);
				}
			}
			else{
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect(x*cellent, (y-1)*cellent, cellent, cellent);
			}
		
			
		}
		
		
		
	}	
}